import java.util.Scanner;

/**
 * Created with Intellij IDEA.
 * Description:
 * User: wangj
 * Date: 2022-01-28
 * Time: 5:48
 */
public class TestDemo {
    public static void main(String[] args) {
        String account="zouyi";
        String password="jia123hui";
        while(true) {
            System.out.print("account:");
            Scanner sc=new Scanner(System.in);
            String s1=sc.next();
            if (s1.equals(account)) {
                int i = 0;
                while (i < 3) {
                    System.out.print("password:");
                    String s2 = sc.next();
                    if (s2.equals(password)) {
                        System.out.println("Login successful");
                        break;
                    } else {
                        if(i==2){
                            System.out.println("Exit program!");
                            break;
                        }
                        else {
                            System.out.println("Incorrect input,Please re-enter!");
                        }
                    }
                    i++;
                }
                break;
            }
        }
    }
}
